<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>居中测试</title>
</head>
<style>
    *{
      margin: 0;
      padding: 0;
    }
    .main{
      background-color: yellow;
    }
    .card{
      width: 200px;
      height: 200px;
      background-color: pink;
      border: 1px solid black;
      margin: 0 auto;
      text-align: center;
      line-height: 200px;
    }
    .contian{
      width: 1000px;
      background-color: skyblue;
      margin: 0 auto;
    }
</style>
<body>
    <div class="main">
        <div class="contian">
          <div class="card">我是内容</div>
          <div class="card">我是内容</div>
          <div class="card">我是内容</div>
          <div class="card">我是内容</div>
          <div class="card">我是内容</div>
        </div>
    </div>
</body>
</html>